import request from '@/utils/request'

// 获取部门列表
export function getDepartment() {
  return request({
    method: 'GET',
    url: '/company/department'
  })
}

// 新增部门
export function addDepartment(data) {
  return request({
    method: 'POST',
    url: '/company/department',
    data
  })
}

// 修改部门详情
export function editDepartment(id, data) {
  return request({
    method: 'PUT',
    url: `/company/department/${id}`,
    data
  })
}

// 获取部门详情
export function getDepartmentDetail(id) {
  return request({
    method: 'GET',
    url: `/company/department/${id}`
  })
}
// 删除部门
export function delDepartment(id) {
  return request({
    method: 'DELETE',
    url: `/company/department/${id}`
  })
}

// 获取部门负责人
export function getLeader() {
  return request({
    method: 'GET',
    url: `/sys/user/simple`
  })
}

// 根据id 获取企业详情
export function getCompanyDetail(id) {
  return request({
    method: 'GET',
    url: `/company/${id}`
  })
}
